package com.diaohw.platform.framework.swagger;

import io.swagger.v3.oas.models.info.Contact;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Data
@Component
@Configuration
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "platform.swagger")
public class SwaggerProperties {
    /**
     * 标题
     */
    private String title;
    /**
     * 描述
     */
    private String description;
    /**
     * 版本
     */
    private String version;

    private String summary;

    private String contactName;

    private String contactUrl;

    private String contactEmail;

    public Contact getContact() {
        Contact contact = new Contact();
        contact.setName(this.contactName);
        contact.setUrl(this.contactUrl);
        contact.setEmail(this.contactEmail);
        return contact;
    }

}
